package cn.itcast.dao;

import cn.itcast.domain.Account;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface AccountDao {
    @Select("select * from account")
    List<Account> findAll();
    @Insert("insert into account(id,name,money) VALUES(#{id},#{name},#{money})")
    int save(Account account)throws Exception;
    @Update("update account set name=#{name}, money=#{money} where id=#{id}")
    int update(Account account)throws Exception;
    @Delete("delete from account where id=#{id}")
    int delete(Integer id)throws Exception;
}